package com.google.code.ptrends.Application.DAL;

import java.util.List;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

import com.google.code.ptrends.Application.DAL.entities.SessionEntity;

@Stateless
@LocalBean
public class SessionServiceBean {

	@PersistenceContext(name = "Application.DAL")
	private EntityManager entityManager;
	
	public SessionServiceBean(){
		
	}
	
	public List<SessionEntity> getAllSessionsWithoutEvents(){
		TypedQuery<SessionEntity> query = entityManager.createQuery(
				"SELECT c FROM SessionEntity c", SessionEntity.class);
		return query.getResultList();
	}
	
}
